import request from '@/utils/request'

// 查询部门树
export function departmentTree() {
  return request({
    url: '/sys/org/departmentTree',
    method: 'get'
  })
}

// 批量删除组织架构
export function deleteOrg(data) {
  return request({
    url: '/sys/org/delete',
    method: 'delete',
    data: data
  })
}
// 批量删除组织架构下的用户
export function deleteUserOrg(data) {
  return request({
    url: '/sys/org/deleteUserOrg',
    method: 'delete',
    data: data
  })
}

// 组织结构下添加用户
export function saveUserOrg(data) {
  return request({
    url: '/sys/org/saveUserOrg',
    method: 'post',
    data: data
  })
}
// 保存组织结构对象
export function saveDepartment(data) {
  return request({
    url: '/sys/org/saveDepartment',
    method: 'post',
    data: data
  })
}
// 保存角色
export function saveRole(data) {
  return request({
    url: '/sys/org/saveRole',
    method: 'post',
    data: data
  })
}
// 查询角色列表
export function listRole() {
  return request({
    url: '/sys/org/listRole',
    method: 'get'
  })
}
// id查询组织架构对象
export function getOrgById(id) {
  return request({
    url: '/sys/org/get/' + id,
    method: 'get'
  })
}
// 查询完整组织架构树
export function fullTree() {
  return request({
    url: '/sys/org/fullTree',
    method: 'get'
  })
}
// 查询组织架构树
export function orgDepartTree() {
  return request({
    url: '/sys/org/orgDepartTree',
    method: 'get'
  })
}
